Centralized scheduling system for operating autonomous driving vehicles

ABSTRACT

An autonomous driving system includes a number of sensors and a number of autonomous driving modules. The autonomous driving system further includes a global store to store data generated and used by processing modules such as sensors and/or autonomous driving modules. The autonomous driving system further includes a task scheduler coupled to the sensors, the autonomous driving modules, and the global store. In response to output data generated by any one or more of processing modules, the task scheduler stores the output data in the global store. In response to a request from any of the processing modules for processing data, the task scheduler provides input data stored in the global store to the processing module. The task scheduler is executed in a single thread that is responsible for managing data stored in the global store and dispatching tasks to be performed by the processing modules.

RELATED APPLICATIONS

This application is related to co-pending U.S. patent application Ser.No. 15/640,842, entitled “Centralized Scheduling System using Event Loopfor Operating Autonomous Driving Vehicles,” filed Jul. 3, 2017 andco-pending U.S. patent application Ser. No. 15/640,917, entitled“Centralized Scheduling System using Global Store for OperatingAutonomous Driving Vehicles,” filed Jul. 3, 2017. The disclosure of theabove applications is incorporated by reference herein in its entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate generally to operatingautonomous vehicles. More particularly, embodiments of the disclosurerelate to scheduling tasks for autonomous driving.

BACKGROUND

Vehicles operating in an autonomous mode (e.g., driverless) can relieveoccupants, especially the driver, from some driving-relatedresponsibilities. When operating in an autonomous mode, the vehicle cannavigate to various locations using onboard sensors, allowing thevehicle to travel with minimal human interaction or in some caseswithout any passengers.

Most of autonomous driving vehicles (ADVs) are controlled usingautonomous driving modules hosted by an operating system such as arobotic operating system (ROS). Existing robotics approach basedautonomous driving systems are implemented using a revised roboticsoperating system that suffers from a variety of deficiencies includingdifficult to deploy, difficult to be used in debugging, and outputinconsistent results for different operations on the same input. Arobotics based system requires modifying some kernel level code of theoperating system to guarantee that it is running in real time.

An autonomous driving system consists of several modules communicatingwith each other frequently. Thus, how to coordinate and orchestrate theinteraction among different modules becomes a core problem of designingan efficient and robust autonomous driving system. The existing solutionis mostly decentralized (meaning that each module runs as a long runningprocess), and employs a publisher-subscriber model of message passing.The multi-process model of modules shares all the resources underneathand may suffer from a race condition for limited resources. Under amulti-process environment, messages are transmitted using apublication/subscription channel over a network. In practice, thisapproach added input/output (IO) overhead to the system and is a majorsource of inconsistency of system behaviors.

Modules are independent and keep running in one process forever, whichmakes failover hard to implement. By its nature, each module resides inits own process space and keeps many of its own states, which makes itimpossible to recover when anything wrong happens within the module. Asa result, the decentralized and distributed system architecture cannotenjoy the advantage of robustness such a system usually has. Even worse,each module in this system could potentially become a single point offailure, which is lethal to an autonomous driving system.

An existing robotics-based autonomous driving system utilizes adecentralized method for data storage and communication. It requirescopying result data from one module to another, which may increase thedelay. The communication protocol to transmit data, like TCP/IP, maycreate redundant packet head, which is also inefficient. The existingsystem adds a lock on data storage since it is written and read viamultiple threads. This might result in a deadlock, which requires extramethods to handle. As a result, the existing system is not able toprovide consistent outputs with the same input since there is no timebound the communications. Delay of communication will result ininconsistent results.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments of the disclosure are illustrated by way of example and notlimitation in the figures of the accompanying drawings in which likereferences indicate similar elements.

FIG. 1 is a block diagram illustrating a networked system according toone embodiment.

FIG. 2 is a block diagram illustrating an example of an autonomousvehicle according to one embodiment.

FIG. 3 is a block diagram illustrating an example of a perception andplanning system used with an autonomous vehicle according to oneembodiment.

FIG. 4 is a diagram illustrating a processing flow of operating anautonomous driving vehicle according to one embodiment.

FIG. 5 is a block diagram illustrating an example of a task managementsystem according to one embodiment.

FIG. 6 is a block diagram illustrating an example of a task managementsystem according to another embodiment.

FIG. 7 is a flow diagram illustrating an example of a processing flow ofa task management system according to one embodiment.

FIG. 8 is a block diagram illustrating an example of a task managementsystem according to another embodiment.

FIG. 9 is a flow diagram illustrating a process of operating anautonomous driving vehicle according to one embodiment.

FIG. 10 is a flow diagram illustrating a process of operating anautonomous driving vehicle according to another embodiment.

FIG. 11 is a flow diagram illustrating a process of operating anautonomous driving vehicle according to another embodiment.

FIG. 12 is a block diagram illustrating a data processing systemaccording to one embodiment.

DETAILED DESCRIPTION

Various embodiments and aspects of the disclosures will be describedwith reference to details discussed below, and the accompanying drawingswill illustrate the various embodiments. The following description anddrawings are illustrative of the disclosure and are not to be construedas limiting the disclosure. Numerous specific details are described toprovide a thorough understanding of various embodiments of the presentdisclosure. However, in certain instances, well-known or conventionaldetails are not described in order to provide a concise discussion ofembodiments of the present disclosures.

Reference in the specification to “one embodiment” or “an embodiment”means that a particular feature, structure, or characteristic describedin conjunction with the embodiment can be included in at least oneembodiment of the disclosure. The appearances of the phrase “in oneembodiment” in various places in the specification do not necessarilyall refer to the same embodiment.

According to one aspect of the disclosure, a centralized schedulingbased autonomous driving system is utilized to solve at least some ofthe above deficiencies. The centralized scheduling system is a singlethreaded system to manage multiple autonomous driving modules (e.g.,perception module, prediction module, decision module, planning module,or control module). With the single threaded system, it will be mucheasier to debug from any time and any internal state of the system. Itgenerates consistent results for different runs on the same input. Thesystem is using centralized scheduling with a single clock to ensureatomic operations of the system. As a result, the system can process theinput and generate the results in the same logical order duringdifferent runs. The executable code of the system lives purely in a usermode or user space such that there is no kernel level modification,which may cause some unpredictable results. The system is independent tothe operating systems and third-party libraries such that it can beportable to different autonomous platforms easily.

In one embodiment, an autonomous driving system includes a number ofsensors (e.g., cameras, LIDAR, radar, IMU, GPS, etc.) and a number ofautonomous driving modules (e.g., perception module, prediction module,decision module, planning module, or control module, etc.). Theautonomous driving system further includes a global store to store datagenerated and used by processing modules such as sensors and/orautonomous driving modules, as well as internal states of the system.The autonomous driving system further includes a task scheduler coupledto the sensors, the autonomous driving modules, and the global store. Inresponse to output data generated by any one or more of processingmodules such as sensors and the autonomous driving modules, the taskscheduler stores the output data in the global store. In response to arequest from any of the processing modules for processing data, the taskscheduler provides input data stored in the global store (also referredto as a global state store, a global storage, a global state storage) tothe processing module. The task scheduler is executed in a single threadthat is solely responsible for managing data stored in the global storeand dispatching tasks to be performed by the processing modules. Allprocessing modules have to go through the task scheduler in order toaccess the global store.

According to another aspect of the disclosure, an event loop basedcentralized scheduler is utilized for an autonomous driving system. Theevent loop is a single-threaded process, which may be implemented as apart of the task scheduler. Access/update to resource and global storeare all via the event loop, where the global store is lock-free by itsnature. The event loop is usually launched or awakened by an event suchas an IO event or a timer event. This non-blocking IO model is highlyefficient and avoids waiting on time consuming IO operations. Instead oflong running processes, processing modules are series of independenttasks. Moreover, these tasks are stateless. Thus, fail-over is easy toimplement by just restarting the module. All the modules areconsolidated into a sequence of processes scheduled by the event loop,which is clean, easy to test and deploy. By having an event loop basedscheduler one can have the chance to make core logic decoupled from IOcommunication, and IO just becomes one of the triggers of the modules.

According to one embodiment, an event queue is maintained to store IOevents generated from a number of sensors and timer events generated fora number of autonomous driving modules. For each of the events pendingin the event queue, in response to determining that the event is an IOevent, the data associated with the IO event is stored in a datastructure associated with the sensor in a global store. In response todetermining that the event is a timer event, a worker thread associatedwith the timer event is launched. The worker thread executes one of theautonomous driving modules triggered or initiated the timer event.Alternatively, a worker thread may be launched or awaken in response toan IO event (e.g., an IO event indicating that point cloud data or GPSdata becomes available). Input data is retrieved from the global storeand provided to the worker thread to allow the worker thread to processthe input data. The above operations are iteratively performed via asingle thread that accesses the event queue and the global store for allof the pending events stored in the event queue.

According to another aspect of the disclosure, a data system, referredto as a global store, is utilized for information storage andcommunication in autonomous driving vehicles. The global store can onlybe accessed by a single thread from a task scheduler so that no lock isneeded, which avoids deadlock fundamentally. Instead of copying data,the task scheduler only passes pointers of data to the autonomousdriving modules so that the communication delay is low and there is noredundant packet head from the communication protocols such as TCP/IP.Data is stored in the order of time stamp. As a result, a simulator canprovide consistent outputs with the same input, which leads to theconvenience of re-producing the potential problems. The global store hasa garbage collection mechanism to control the memory usage by archivingolder data in an archiving device. It is easy to monitor the currentglobal since all the newest updates are collected in the global store.

According to one embodiment, a global store is maintained to store anumber of data structures (e.g., linked lists). Each data structureincludes a number of entries and each entry stores data of one of theevents in a chronological order. Each data structure is associated withone of the sensors or the autonomous driving modules of an autonomousdriving vehicle. When a first event associated with a first autonomousdriving module is received, where the first event includes a first topicID, the first topic ID is hashed to identify one or more first datastructures corresponding to the first event. Pointers (e.g., a memorypointer) pointing to heads of the first data structures are passed tothe first autonomous driving module to allow the first autonomousdriving module to process data associated with the first event. Sincethe pointers of the first data structures are passed to the firstautonomous driving module, there is no need to copy the data of thefirst data structures. Instead, the first autonomous driving module candirectly access the data via the pointers.

When a notification is received from the first autonomous driving moduleindicating that the data of the first event has been processed, one ormore second data structures stored in the global store are identified,where the second data structures are associated with the firstautonomous driving module. The second data structures may be configuredto store output data of the first autonomous driving module. A result ofprocessing the data of the first event is then pushed onto the head ofthe second data structures. When a second event associated with a firstsensor is received, a second topic ID associated with the second eventis hashed to identify a third data structure. Data is then obtained fromthe second event and pushed onto a head of the third data structure,including a timestamp of the third event.

FIG. 1 is a block diagram illustrating an autonomous vehicle networkconfiguration according to one embodiment of the disclosure. Referringto FIG. 1, network configuration 100 includes autonomous vehicle 101that may be communicatively coupled to one or more servers 103-104 overa network 102. Although there is one autonomous vehicle shown, multipleautonomous vehicles can be coupled to each other and/or coupled toservers 103-104 over network 102. Network 102 may be any type ofnetworks such as a local area network (LAN), a wide area network (WAN)such as the Internet, a cellular network, a satellite network, or acombination thereof, wired or wireless. Server(s) 103-104 may be anykind of servers or a cluster of servers, such as Web or cloud servers,application servers, backend servers, or a combination thereof. Servers103-104 may be data analytics servers, content servers, trafficinformation servers, map and point of interest (MPOI) severs, orlocation servers, etc.

An autonomous vehicle refers to a vehicle that can be configured to inan autonomous mode in which the vehicle navigates through an environmentwith little or no input from a driver. Such an autonomous vehicle caninclude a sensor system having one or more sensors that are configuredto detect information about the environment in which the vehicleoperates. The vehicle and its associated controller(s) use the detectedinformation to navigate through the environment. Autonomous vehicle 101can operate in a manual mode, a full autonomous mode, or a partialautonomous mode.

In one embodiment, autonomous vehicle 101 includes, but is not limitedto, perception and planning system 110, vehicle control system 111,wireless communication system 112, user interface system 113,infotainment system 114, and sensor system 115. Autonomous vehicle 101may further include certain common components included in ordinaryvehicles, such as, an engine, wheels, steering wheel, transmission,etc., which may be controlled by vehicle control system 111 and/orperception and planning system 110 using a variety of communicationsignals and/or commands, such as, for example, acceleration signals orcommands, deceleration signals or commands, steering signals orcommands, braking signals or commands, etc.

Components 110-115 may be communicatively coupled to each other via aninterconnect, a bus, a network, or a combination thereof. For example,components 110-115 may be communicatively coupled to each other via acontroller area network (CAN) bus. A CAN bus is a vehicle bus standarddesigned to allow microcontrollers and devices to communicate with eachother in applications without a host computer. It is a message-basedprotocol, designed originally for multiplex electrical wiring withinautomobiles, but is also used in many other contexts.

Referring now to FIG. 2, in one embodiment, sensor system 115 includes,but it is not limited to, one or more cameras 211, global positioningsystem (GPS) unit 212, inertial measurement unit (IMU) 213, radar unit214, and a light detection and range (LIDAR) unit 215. GPS system 212may include a transceiver operable to provide information regarding theposition of the autonomous vehicle. IMU unit 213 may sense position andorientation changes of the autonomous vehicle based on inertialacceleration. Radar unit 214 may represent a system that utilizes radiosignals to sense objects within the local environment of the autonomousvehicle. In some embodiments, in addition to sensing objects, radar unit214 may additionally sense the speed and/or heading of the objects.LIDAR unit 215 may sense objects in the environment in which theautonomous vehicle is located using lasers. LIDAR unit 215 could includeone or more laser sources, a laser scanner, and one or more detectors,among other system components. Cameras 211 may include one or moredevices to capture images of the environment surrounding the autonomousvehicle. Cameras 211 may be still cameras and/or video cameras. A cameramay be mechanically movable, for example, by mounting the camera on arotating and/or tilting a platform.

Sensor system 115 may further include other sensors, such as, a sonarsensor, an infrared sensor, a steering sensor, a throttle sensor, abraking sensor, and an audio sensor (e.g., microphone). An audio sensormay be configured to capture sound from the environment surrounding theautonomous vehicle. A steering sensor may be configured to sense thesteering angle of a steering wheel, wheels of the vehicle, or acombination thereof. A throttle sensor and a braking sensor sense thethrottle position and braking position of the vehicle, respectively. Insome situations, a throttle sensor and a braking sensor may beintegrated as an integrated throttle/braking sensor.

In one embodiment, vehicle control system 111 includes, but is notlimited to, steering unit 201, throttle unit 202 (also referred to as anacceleration unit), and braking unit 203. Steering unit 201 is to adjustthe direction or heading of the vehicle. Throttle unit 202 is to controlthe speed of the motor or engine that in turn control the speed andacceleration of the vehicle. Braking unit 203 is to decelerate thevehicle by providing friction to slow the wheels or tires of thevehicle. Note that the components as shown in FIG. 2 may be implementedin hardware, software, or a combination thereof.

Referring back to FIG. 1, wireless communication system 112 is to allowcommunication between autonomous vehicle 101 and external systems, suchas devices, sensors, other vehicles, etc. For example, wirelesscommunication system 112 can wirelessly communicate with one or moredevices directly or via a communication network, such as servers 103-104over network 102. Wireless communication system 112 can use any cellularcommunication network or a wireless local area network (WLAN), e.g.,using WiFi to communicate with another component or system. Wirelesscommunication system 112 could communicate directly with a device (e.g.,a mobile device of a passenger, a display device, a speaker withinvehicle 101), for example, using an infrared link, Bluetooth, etc. Userinterface system 113 may be part of peripheral devices implementedwithin vehicle 101 including, for example, a keyword, a touch screendisplay device, a microphone, and a speaker, etc.

Some or all of the functions of autonomous vehicle 101 may be controlledor managed by perception and planning system 110, especially whenoperating in an autonomous driving mode. Perception and planning system110 includes the necessary hardware (e.g., processor(s), memory,storage) and software (e.g., operating system, planning and routingprograms) to receive information from sensor system 115, control system111, wireless communication system 112, and/or user interface system113, process the received information, plan a route or path from astarting point to a destination point, and then drive vehicle 101 basedon the planning and control information. Alternatively, perception andplanning system 110 may be integrated with vehicle control system 111.

For example, a user as a passenger may specify a starting location and adestination of a trip, for example, via a user interface. Perception andplanning system 110 obtains the trip related data. For example,perception and planning system 110 may obtain location and routeinformation from an MPOI server, which may be a part of servers 103-104.The location server provides location services and the MPOI serverprovides map services and the POIs of certain locations. Alternatively,such location and MPOI information may be cached locally in a persistentstorage device of perception and planning system 110.

While autonomous vehicle 101 is moving along the route, perception andplanning system 110 may also obtain real-time traffic information from atraffic information system or server (TIS). Note that servers 103-104may be operated by a third party entity. Alternatively, thefunctionalities of servers 103-104 may be integrated with perception andplanning system 110. Based on the real-time traffic information, MPOIinformation, and location information, as well as real-time localenvironment data detected or sensed by sensor system 115 (e.g.,obstacles, objects, nearby vehicles), perception and planning system 110can plan an optimal route and drive vehicle 101, for example, viacontrol system 111, according to the planned route to reach thespecified destination safely and efficiently.

Server 103 may be a data analytics system to perform data analyticsservices for a variety of clients. In one embodiment, data analyticssystem 103 includes data collector 121 and machine learning engine 122.Data collector 121 collects driving statistics 123 from a variety ofvehicles, either autonomous vehicles or regular vehicles driven by humandrivers. Driving statistics 123 include information indicating thedriving commands (e.g., throttle, brake, steering commands) issued andresponses of the vehicles (e.g., speeds, accelerations, decelerations,directions) captured by sensors of the vehicles at different points intime. Driving statistics 123 may further include information describingthe driving environments at different points in time, such as, forexample, routes (including starting and destination locations), MPOIs,road conditions, weather conditions, etc. Based on driving statistics123, machine learning engine 122 generates or trains a set of rules,algorithms, and/or predictive models 124 for a variety of purposes.Rules 124 may include rules to recognize and conceive objects in adriving environment surrounding an ADV. Rules 124 may include rules toplan and control the ADV, etc.

FIG. 3 is a block diagram illustrating an example of a perception andplanning system used with an autonomous vehicle according to oneembodiment. System 300 may be implemented as a part of autonomousvehicle 101 of FIG. 1 including, but is not limited to, perception andplanning system 110, control system 111, and sensor system 115.Referring to FIG. 3, perception and planning system 110 includes, but isnot limited to, localization module 301, perception module 302,prediction module 303, decision module 304, planning module 305, controlmodule 306, and task management system 307. Modules 301-306, as well asother components or modules that are involved to drive an ADV, arereferred to as autonomous driving modules (ADMs).

Some or all of modules 301-308 may be implemented in software, hardware,or a combination thereof. For example, these modules may be installed inpersistent storage device 352, loaded into memory 351, and executed byone or more processors (not shown). Note that some or all of thesemodules may be communicatively coupled to or integrated with some or allmodules of vehicle control system 111 of FIG. 2. Some of modules 301-307may be integrated together as an integrated module.

Referring now to FIG. 3 and FIG. 4, localization module 301 determines acurrent location of autonomous vehicle 300 (e.g., leveraging GPS unit212) and manages any data related to a trip or route of a user.Localization module 301 (also referred to as a map and route module)manages any data related to a trip or route of a user. A user may log inand specify a starting location and a destination of a trip, forexample, via a user interface. Localization module 301 communicates withother components of autonomous vehicle 300, such as map and routeinformation 311, to obtain the trip related data. For example,localization module 301 may obtain location and route information from alocation server and a map and POI (MPOI) server. A location serverprovides location services and an MPOI server provides map services andthe POIs of certain locations, which may be cached as part of map androute information 311. While autonomous vehicle 300 is moving along theroute, localization module 301 may also obtain real-time trafficinformation from a traffic information system or server.

Based on the sensor data provided by sensor system 115 and localizationinformation obtained by localization module 301, a perception of thesurrounding environment is determined by perception module 302. Theperception information may represent what an ordinary driver wouldperceive surrounding a vehicle in which the driver is driving. Theperception can include the lane configuration (e.g., straight or curvelanes), traffic light signals, a relative position of another vehicle, apedestrian, a building, crosswalk, or other traffic related signs (e.g.,stop signs, yield signs), etc., for example, in a form of an object.

Perception module 302 may include a computer vision system orfunctionalities of a computer vision system to process and analyzeimages captured by one or more cameras in order to identify objectsand/or features in the environment of autonomous vehicle. The objectscan include traffic signals, road way boundaries, other vehicles,pedestrians, and/or obstacles, etc. The computer vision system may usean object recognition algorithm, video tracking, and other computervision techniques. In some embodiments, the computer vision system canmap an environment, track objects, and estimate the speed of objects,etc. Perception module 302 can also detect objects based on othersensors data provided by other sensors such as a radar and/or LIDAR.

For each of the objects, prediction module 303 predicts what the objectwill behave under the circumstances. The prediction is performed basedon the perception data perceiving the driving environment at the pointin time in view of a set of map/rout information 311 and traffic rules312. For example, if the object is a vehicle at an opposing directionand the current driving environment includes an intersection, predictionmodule 303 will predict whether the vehicle will likely move straightforward or make a turn. If the perception data indicates that theintersection has no traffic light, prediction module 303 may predictthat the vehicle may have to fully stop prior to enter the intersection.If the perception data indicates that the vehicle is currently at aleft-turn only lane or a right-turn only lane, prediction module 303 maypredict that the vehicle will more likely make a left turn or right turnrespectively.

For each of the objects perceived by perception module 302 and potentialmovement of the objects predicted by prediction module 303, decisionmodule 304 makes a decision regarding how to handle the object. Forexample, for a particular object (e.g., another vehicle in a crossingroute) as well as its metadata describing the object (e.g., a speed,direction, turning angle), decision module 304 decides how to encounterthe object (e.g., overtake, yield, stop, pass). Decision module 304 maymake such decisions according to a set of rules such as traffic rules ordriving rules 312, which may be stored in persistent storage device 352.

Based on a decision for each of the objects perceived, planning module305 plans a path or route for the autonomous vehicle, as well as drivingparameters (e.g., distance, speed, and/or turning angle). That is, for agiven object, decision module 304 decides what to do with the object,while planning module 305 determines how to do it. For example, for agiven object, decision module 304 may decide to pass the object, whileplanning module 305 may determine whether to pass on the left side orright side of the object. Planning and control data is generated byplanning module 305 including information describing how vehicle 300would move in a next moving cycle (e.g., next route/path segment). Forexample, the planning and control data may instruct vehicle 300 to move10 meters at a speed of 30 mile per hour (mph), then change to a rightlane at the speed of 25 mph.

Based on the planning and control data, control module 306 controls anddrives the autonomous vehicle, by sending proper commands or signals tovehicle control system 111, according to a route or path defined by theplanning and control data. The planning and control data includesufficient information to drive the vehicle from a first point to asecond point of a route or path using appropriate vehicle settings ordriving parameters (e.g., throttle, braking, and turning commands) atdifferent points in time along the path or route.

In one embodiment, the planning phase is performed in a number ofplanning cycles, also referred to as command cycles, such as, forexample, in every time interval of 100 milliseconds (ms). For each ofthe planning cycles or command cycles, one or more control commands willbe issued based on the planning and control data. That is, for every 100ms, planning module 305 plans a next route segment or path segment, forexample, including a target position and the time required for the ADVto reach the target position. Alternatively, planning module 305 mayfurther specify the specific speed, direction, and/or steering angle,etc. In one embodiment, planning module 305 plans a route segment orpath segment for the next predetermined period of time such as 5seconds. For each planning cycle, planning module 305 plans a targetposition for the current cycle (e.g., next 5 seconds) based on a targetposition planned in a previous cycle. Control module 306 then generatesone or more control commands (e.g., throttle, brake, steering controlcommands) based on the planning and control data of the current cycle.

Note that decision module 304 and planning module 305 may be integratedas an integrated module. Decision module 304/planning module 305 mayinclude a navigation system or functionalities of a navigation system todetermine a driving path for the autonomous vehicle. For example, thenavigation system may determine a series of speeds and directionalheadings to effect movement of the autonomous vehicle along a path thatsubstantially avoids perceived obstacles while generally advancing theautonomous vehicle along a roadway-based path leading to an ultimatedestination. The destination may be set according to user inputs viauser interface system 113. The navigation system may update the drivingpath dynamically while the autonomous vehicle is in operation. Thenavigation system can incorporate data from a GPS system and one or moremaps so as to determine the driving path for the autonomous vehicle.

Decision module 304/planning module 305 may further include a collisionavoidance system or functionalities of a collision avoidance system toidentify, evaluate, and avoid or otherwise negotiate potential obstaclesin the environment of the autonomous vehicle. For example, the collisionavoidance system may effect changes in the navigation of the autonomousvehicle by operating one or more subsystems in control system 111 toundertake swerving maneuvers, turning maneuvers, braking maneuvers, etc.The collision avoidance system may automatically determine feasibleobstacle avoidance maneuvers on the basis of surrounding trafficpatterns, road conditions, etc. The collision avoidance system may beconfigured such that a swerving maneuver is not undertaken when othersensor systems detect vehicles, construction barriers, etc. in theregion adjacent the autonomous vehicle that would be swerved into. Thecollision avoidance system may automatically select the maneuver that isboth available and maximizes safety of occupants of the autonomousvehicle. The collision avoidance system may select an avoidance maneuverpredicted to cause the least amount of acceleration in a passenger cabinof the autonomous vehicle.

According to one embodiment, task management system 307 is configured tocommunicate with any of the processing modules, such as modules 301-306and sensors of sensor system 115, as well as other modules involved todrive the ADV, to dispatch and coordinate tasks to be performed by theprocessing modules. Each of the tasks performed by modules 301-306 andsensor system 115 is scheduled and coordinated by task management system307 in an efficient way. According to one embodiment, task managementsystem 307 is a single threaded system to manage and/or coordinateoperations of the processing modules. With the single threaded system,it will be much easier to debug from any time and any internal state ofthe system. It generates consistent results for different runs on thesame input. The system is using centralized scheduling with a singleclock to ensure atomic operations of the system. As a result, the systemwill process the input and output the results in the same logical orderduring different runs. The executable code of the system lives purely ina user space such that there is no kernel level modification required,which may cause some unpredictable results. The system is independent tothe operating systems and third-party libraries such that it can beportable to different autonomous vehicles easily.

FIG. 5 is a block diagram illustrating an example of a task managementsystem according to one embodiment. System 500 may be implemented as apart of system 300 of FIG. 3. Referring to FIG. 5, system 500 includestask management system 307 communicatively coupled to autonomous drivingmodules 501 and sensor system 115, as well as other components ormodules (e.g., monitor 316, user display system 502). Autonomous drivingmodules 501 may include any of the components involved to drive the ADV,such as, localization module 301, perception module 302, predictionmodule 303, decision module 304, planning module 305, and control module306. In one embodiment, task management system 307 includes, but is notlimited to, task scheduler 511, global store 512, IO hub interfacemodule 513, data adaptor 514, timer module 515, and archiving module517. Task scheduler 511 is a centralized scheduler that centrallymanages communications amongst all parties, such as sensor system 115and autonomous driving modules 501. In one embodiment, task scheduler511 is executed as a single threaded process that is exclusivelyresponsible for managing data stored in global store 512. Other parties,such as sensor system 115 and autonomous driving modules 501, have to gothrough task scheduler 511 in order to access global store 512.

Task scheduler 511 is a core part of the task management system 307.Every time when a task is triggered to be performed, a correspondingworker thread is launched or woke up to process associated task. Afterthe worker thread finishes the task, either successful or failed, theworker thread notifies task scheduler 511 to write any result (if thereis any) to global store 512. Task scheduler 511 is in charge of handlingthe triggered tasks and executing them using worker threads. A task canbe storing sensor data produced by any of the sensors in sensor system115. Alternatively, a task can be processing sensor data (e.g., LIDARdata) produced by one or more sensors by an autonomous driving module(e.g., perception module 302). Further, a task can be processing, by anautonomous driving module (e.g., decision module 304), output dataproduced by one or more other autonomous driving modules (e.g.,perception module 302) and output data produced by one or more sensors.

IO hub interface module 513 is responsible for interfacing IO devices,in this example, sensors of sensor system 115, with task scheduler 511.IO hub interface module 513 is used to handle all the input data fromsensors of an ADV. It continuously processes the raw sensor data andrequests task scheduler 511 to write the processed sensor data intoglobal store 512 to be utilized as input data for other tasks. IO hubinterface module 513 may include one or more sensor driverscorresponding to sensors of sensor system 115. Each of the sensors ofsensor system 115 may be associated with a specific sensor driver tocommunicate with the sensor (e.g., hardware such as registers of thesensor) including reading and/or processing sensor data from the sensor.Data adapter 514 is an optional data conversion module to convert aspecific format of sensor data to a predetermined or unified data formatthat is suitable to be stored in global store 512 and recognizable byother related parties such as autonomous driving modules 501. With theoptional data adaptor 514, a third party sensor and/or a third-partysensor driver with a proprietary component or format can be utilized.

According to one embodiment, when any of sensors of sensor system 115senses and produces sensor data, a corresponding sensor driver obtainsthe sensor data from the sensor and communicates with task scheduler511. In one embodiment, the sensor driver triggers an IO event, forexample, through an interrupt or via an application programminginterface (API), to notify task scheduler 511 indicating that there isnew sensor data available for processing. In response to the IO event,task scheduler 511 retrieves the sensor data through the IO event andstores the sensor data in a data structure stored in global store 512 asa part of sensor data 521. In addition, after storing the sensor data inglobal store 512, according to one embodiment, task scheduler 511 maylaunch or wake up a worker thread of a processing module (e.g.,perception module 302) to process the newly received sensor data. Taskscheduler 511 is configured to identify a particular processing moduleto process the sensor data based on a type of sensor data.

The data structure is specifically configured to store the sensor datafor that particular sensor. That is global store 512 may include anumber of data structures for storing sensor data for sensors of sensorsystem 115, each data structure corresponding to one or more of thesensors of sensor system 115. Task scheduler 511 handles the IO eventsone at a time via a single threaded process. All IO events may behandled according to a chronological order such as afirst-come-first-served manner. Alternatively, the IO events may behandled according to priorities of the IO events, where different typesof IO events may be associated with different priorities. As a result,the race condition for resource contention in a conventional system canbe avoided.

According to one embodiment, for at least some of the autonomous drivingmodules 501, timer module or timer logic 515 periodically generates oneor more timer events that will lapse within a predetermined period oftime, such as 100 milliseconds. When a timer event associated with aparticular autonomous driving module lapses, a worker thread hosting theautonomous driving module is launched or woke up to process data. In oneembodiment, in response to a timer event, task scheduler 511 examinesthe timer event to identify one of the corresponding autonomous drivingmodules associated with the timer event. That is, the timer event mayinclude certain information identifying the corresponding autonomousdriving module such as a module ID of the autonomous driving module.

In addition, according to one embodiment, the timer event may furtheridentify the input data that will be processed by the autonomous drivingmodule. For example, the timer event may indicate that a particularautonomous driving module (e.g., perception module) needs to process thepoint cloud data produced by LIDAR device 215. As a result, taskscheduler 511 identifies a data structure of global store 512 thatstores the sensor data produced by LIDAR device 215. Task scheduler 511then launches or wakes up a worker thread that executes thecorresponding autonomous driving module and passes a pointer of theidentified data structure as an input to the autonomous driving module.The autonomous driving module then can process the data stored in thedata structure via the pointer passed from task scheduler 511 withouthaving to copy the data, which tends to be slow and resource consuming.The results of the autonomous driving module are stored back as a partof autonomous driving data 522 in global store 512.

The global store 512 is used to store all the information used in theautonomous driving system, including the processed raw data from thesensors (e.g., sensor data 521), the internal state 523 of the system,and the results of the tasks (e.g., autonomous driving data 522). Theglobal store 512 is lock free to accelerate operations of the wholesystem and it periodically dumps out-of-date data into a persistentstorage as logs for disaster back-ups, debugging and system improvingetc.

Monitor 516 is an optional monitoring system configured to record thestates of the system and send alerts to the appropriate parties when itdetects certain abnormal behaviors to keep the safety of the autonomousdriving. Global store 512 can be read by other components such as userdisplay system 502. User display system 502 is used to show necessaryinformation of the autonomous driving system in order to for user tounderstand the operating states of the ADV. At least some of the datastored in global store 512 can be archived to persistent storage device352 as a part of event logs 503. The system may further include agrading system configured to evaluate the performance of the autonomousdriving system in view of several metrics, such as no collisions, obeystraffic rules, reaching destination, and ride experience, etc. Theevaluation results may be used to improve the whole autonomous drivingsystem as feedbacks. The system may further include an agent systemconfigured to generate some virtual agents, such as static objects,moving objects (e.g., vehicles, pedestrians), etc. to simulate somescenarios during the system development.

Note that the memory space of global store 512 may be maintained in alimited space. Thus, periodically, archiving module 517 (e.g., a garbagecollection module) may archive any data that is unlikely used in globalstore 512 into persistent storage device 352 as a part of event logs503. As a result, the memory space of the archived data can be releasedand/or reused. In one embodiment, any data older than a predeterminedtime threshold with respect to a current system time may be removed fromglobal store 512 and stored in persistent storage device 352 as a partof event logs 503. The time threshold for archiving may be userconfigurable dependent upon the available system resources of the system(e.g., an amount of memory available to host global store 512).Archiving module 317 can compare a timestamp of each event entry againsta current system time to determine whether that particular event entryshould be archived.

FIG. 6 is a block diagram illustrating an example of a task managementsystem according to another embodiment. Referring to FIG. 6, system 600includes an event queue 601 to store and buffer pending events that aregenerated from IO handler 602 and timer handler 603. IO handler 602 maybe implemented as a part of IO hub interface 513 and timer handler 603may be implemented as a apart of timer module 515. In one embodiment,task scheduler 511 includes an event loop module 610. Event loop module610 is executed as a single threaded process. Access and updates tosystem resources and global store 512 are all via event loop module 610,which is a lock-free by nature. Event loop module 610 is usually awakenby an IO event triggered by IO handler 602 or a timer event triggered bytimer handler 603. This non-blocking IO model is highly efficient andavoids waiting on time consuming IO operations as found in conventionalsystems.

Instead of long running processes, modules (e.g., autonomous drivingmodules, user display system, monitor) are implemented as series ofindependent tasks carried by respective worker threads, which may bemaintained as a part of worker thread pool 604. The tasks are statelessprocesses and executed by respective threads asynchronously andindependently. Thus, fail-over can be easily implemented, for example,by simply restarting the modules. All of the modules are launched orawakened by event loop module 610 in series, one at a time, which isclean and easy to test and deploy. By having an event loop basedscheduler, the core scheduling logic can be decoupled from the IOcommunication and the IO just becomes one of the triggering logic of themodules.

Global store 512 contains a number of event data structures. Each eventdata structure corresponds to one of the parties involved herein, suchas, for example, sensors of sensor system 115 and processing modules(e.g., autonomous driving modules 501, user display system 502, monitor516, and archiving module 517). Each event data structure includes anumber of event entries and each event entry stores event data of aparticular event, including a timestamp of the event and data associatedwith the event (e.g., data generated by a corresponding party orcomponent). An event data structure may be implemented in a variety ofmanners, such as, for example, an array, a circular buffer, a linkedlist, a table, a database, etc.

In one embodiment, worker thread pool 604 contains a pool of workerthreads that are ready to perform tasks. A task is performed by anexecutable code of a module executed by the corresponding worker thread.Once the task is completed, the worker thread will notify event loopmodule 610 via a callback interface. The notification may furtherincludes a result or status of the task. In response to thenotification, event loop module 610 writes the result or status as anentry into a data structure corresponding to the module that initiatedthe callback in global store 512. Alternatively, event loop module 610may write the result into one or more data structures, which may bepreconfigured or specified by the notification.

IO handler 602 communicates with sensors of sensor system 115, where IOhandler 602 may include one or more sensor drivers 611-613 thatspecifically handle communications with the corresponding sensors. Whena sensor captures sensor data, a corresponding sensor driver of IOhandler 602 obtains the sensor data, optionally invokes a data adaptorto convert the format of the sensor data, and transmits the sensor datato task scheduler 511 to be written into a data structure associatedwith the sensor in global store 512. In one embodiment, in response tosensor data produced by a sensor, a sensor driver associated with thesensor generates an IO event, for example, via an interrupt or a call toa predetermined API. IO handler 602 pushes the IO event into a tail ofevent queue 601. Once the IO event has been pushed into the tail ofevent queue 601, event loop module 610 may be notified or awakened. Inaddition, for certain type of sensor data (e.g., point cloud datagenerated from LIDAR device 215), after storing the sensor data inglobal store 512, event loop 610 may launch or wake up a processingmodule that is configured to process the sensor data, such as perceptionmodule 302. In this scenario, a worker thread of an autonomous drivingmodule is launched or awaken in response to an IO event.

Timer handler 603 is configured to handle timer events for processingmodules, such as autonomous driving modules 501, user display system502, monitor 516, and archiving module 517, etc. Timer handler 603 mayinclude timer logic 621-623 configured to specifically generate timerevents for the corresponding processing modules. In one embodiment, foreach of the processing modules, timer handler 603 periodically generatesat least one timer event. The timer event may be inserted or pushed intoa tail of event queue 610. A timer event may be triggered for everypredetermined period of time such as 100 milliseconds. The periodic timeperiod for a timer event may be the same or different for differentprocessing modules. Multiple timer events may be generated for a singleprocessing module. For example, as shown in FIG. 4, decision module 304may require input data from perception module 302 and prediction module303. In this example, a first timer event may be generated for decisionmodule 304 indicating that the first timer event requires an input ofdata generated from perception module 302. A second timer event may begenerated for decision module 304 indicating that the second timer eventrequires an input of data generated from prediction module 303.Alternatively, a single timer event may be generated specifying thatdata of both perception module 302 and prediction module 303 arerequired. The IO events and the timer events are chronologically pushedinto the tail of event queue 601 as a part of pending events 631-635.

In one embodiment, event loop module 610 periodically (e.g., via aninternal clock, or notified by an event) loops through event queue 601to determine whether there is any event pending to be processed. If itis determined there is at least one event pending in event queue 601,event loop module 610 pops or removes a top event from a head of eventqueue 601. As described above, when a new event is generated, the newevent is pushed into the tail of event queue 601, while event loopmodule 610 processes the events from the head of event queue 601. Thus,the events are processed in a first-in-first-out (FIFO) orfirst-come-first-served manner, i.e., a chronological order from theoldest event to the newest event.

In response to an event retrieved from the head of event queue 601,event loop module 610 examines event data of the event to determine anowner of the event, as well as required input data of the event. Asdescribed above, an event can be an IO event generated by IO handler 602or a timer event generated by a timer handler 603. All of the IO eventsand timer events may be pushed into the tail of event queue 601according to a first-come-first-served manner. Alternatively, eventqueue 601 may include a first specific event queue for IO events and asecond specific event queue for timer events. Further, if certain eventshave different priorities, multiple event queues, each being associatedwith a different priority, may be maintained and utilized forprioritized task dispatches.

In one embodiment, in response to an IO event popped from the head ofevent queue 601, event loop 610 examines event data of the IO event toidentify an owner of the IO event. An IO event may be triggered by anowner representing any of the sensors of sensor system 115. Once theowner of the IO event has been identified, an event data structureassociated with the owner is identified. Event data of the IO event isthen stored in the identified event data structure.

In one embodiment, referring to FIG. 6 and FIG. 7, in response to atimer event popped from the head of event queue 601 via path 701, eventloop module 610 examines event data of the timer event to identify anowner of the timer event, as well as input data required by the timerevent. Optionally if the event data has not been stored, event loopmodule 610 stores the event data in global store 512 via path 702. Forexample, a timer event may be generated for decision module 304 toprocess perception data generated by perception module 302. The timerevent in this situation will specify that an owner of the timer event isdecision module 304 and the required input data includes perception dataproduced by perception module 302.

In response the event, event loop module 610 allocates, launches, and/orwakes up worker thread 710 from worker thread pool 604 that correspondsto the event via path 703. Worker thread pool 604 includes a number ofworker threads 641-646, one for each of the processing modules thatprocess data stored in global store 512. For example, perception threadis the worker thread configured to execute an executable code image ofperception module 302. If the worker thread has already been allocatedand launched, event loop module 610 simply wakes up the worker thread.For example, if the event belongs to decision module 304, event loopmodule 610 launches or wakes up a decision thread. In addition, eventloop module 610 passes a memory pointer pointing to a memory locationstoring a data structure of global store 512 that stores the requiredinput data to the worker thread. Worker thread 710 can directly retrieve(e.g., in a read-only manner) the input data from the data structure viathe memory pointer via path 704, without having to copy the input data.In the above example of decision module 304 processing perception dataof perception module 302, event loop module 610 would pass the pointerof a data structure storing perception data for perception module 302 toa worker thread associated with decision module 304. Note that if aprocessing module requires input data from multiple data structures,which may be indicated based on the event, pointers of the datastructures are then passed to the processing module.

In operation 705, worker thread 710 processes the input data. Once theinput data has been processed, worker thread 710 notifies event loopmodule 610 via path 706, for example, using a callback mechanism. Thenotification may include a result of processing the input data or astatus of the processing (e.g., success or failure). In response to thenotification, event loop module 610 stores the result and/or status ofworker thread 710 in global store 512. In one embodiment, in response tothe notification from worker thread 710, event loop module 610identifies a data structure that stores results for worker thread 710 inglobal store 512. Typically, the data structure is associated with aprocessing module executed or hosted by worker thread 710. In the aboveexample of decision module 304 processing perception data of perceptionmodule 302, event loop module 610 would identify a data structurecorresponding to decision module 304 and store the result of workerthread 710 in the data structure of decision module 304 in global store512.

Thus, in this configuration, the output data of a first processingmodule may be utilized as input data of a second processing module.Since all data produced by all relevant processing modules are allstored in appropriate data structures and the pointers of the datastructures are passed onto a next processing module, which are allmanaged by event loop module 610 executed in a single processing thread,there is no need of copying data during the processes. Note that aworker thread may process input data stored in multiple data structuresof global store 512. Similarly, a work thread may generate output datato be stored in multiple data structures in global store 512. Forexample, referring back to FIG. 4, the output data produced by decisionmodule 304 may be stored in global store 512. The output data ofdecision module 304 may be retrieved from global store 512 and utilizedas input data by planning module 305 subsequently. The output data ofplanning module 305 may be stored in global store 512 and subsequentlyutilized as input data for control module 306, etc.

FIG. 8 is a block diagram illustrating an example of task management ofan autonomous driving vehicle according to another embodiment. Referringto FIG. 8, global store 512 includes a number of data structures such asdata structures 801-803. Each of the data structures is associated witha processing module to store output data generated by the correspondingprocessing module. A processing module can be any one of sensors insensor system 115 and any one of autonomous driving modules 501. Asdescribed above, communications amongst the processing modules areperformed by sharing data via global store 512.

In one embodiment, a message publication and subscription mechanism isutilized to manage the data shared by the processing modules. In thisexample, each of data structures 801-803 is configured to store aparticular topic of messages produced by a particular publisher. A topicmay include a unique identifier identifying a publisher. A publisherrefers to a processing module that can produce output data, for example,in a form of messages stored in a data structure of the correspondingtopic. For example, a topic can be “perception” that is associated withperception module 302. A data structure of a topic of “perception” isconfigured to store any output data generated by perception module 302,although perception module 302 may generate data to be stored inmultiple data structures to be processed by multiple processing modules.Similarly, a data structure with a topic of “LIDAR” is configured tostore sensor data produced by LIDAR device 215.

In one embodiment, each of data structures 801-803 includes a number ofevent entries (e.g., message entries) and each event entry stores eventdata of a particular event (e.g., a message). Each of data structures801-803 may be implemented in a variety of formats, such as, forexample, an array, a circular buffer, a linked list, a table, adatabase, etc. In this embodiment, data structures 801-803 areimplemented as linked list data structures. A linked list is a linearcollection of data elements, called nodes, each pointing to the nextnode by means of a pointer. It is a data structure consisting of a groupof nodes which together represent a sequence. Under the simplest form,each node is composed of data and a reference (i.e., a link) to the nextnode in the sequence. A linked list structure allows for efficientinsertion or removal of elements from any position in the sequenceduring iteration.

According to one embodiment, when an IO event is triggered from asensor, task scheduler 511 determines a topic associated with the sensoras a publisher based on the IO event. The 10 event may include anidentifier as a topic identifying the sensor. Based on the identifier ofthe sensor, one of data structures 801-803 is identified. Task scheduler511 the pushes the event data into the head of the data structure. Notethat the event may be buffered and stored in event queue 601 by IOhandler 602 and task scheduler 511 is notified or periodically“walks”through the pending events in event queue 601. In response to a pendingevent in event queue 601, task scheduler 511 retrieves the event datafrom the event queue 601 and inserts the event data into the head of thedata structure. For example, it is assumed data structure 801 isconfigured to store sensor data generated by LIDAR device 215. Inresponse to an IO event triggered by LIDAR device 215, task scheduler511 retrieves the event and its event data from the head of event queue601. Based on the retrieved event, task scheduler 511 identifies datastructure 801 that is associated with LIDAR device 215. Task scheduler511 then inserts the event data into the head of data structure 801.

In one embodiment, task scheduler 511 maintains a hash table or hashdata structure 810 as a quick lookup mechanism to determine which ofdata structures 801-803 is associated with a particular event. Inresponse to a particular event, task scheduler 511 obtains a topicassociated with the event, where the topic uniquely represents anevent/message publisher or producer (e.g., LIDAR device 215, perceptionmodule 302). Task scheduler 511 hashes the topic using hash table 810 toproduce a data structure identifier that identifies one of datastructures 801-803. The output of the hash operation may include apointer pointing to a memory location storing the identified datastructure. The pointer may be a memory pointer pointing to the head ofthe data structure. Task scheduler 511 then inserts the event data ofthe event onto the head of the data structure.

According to one embodiment, in response to a timer event, which may beretrieved from the head of event queue 601, task scheduler 511determines an owner of the timer event. An owner of an event refers toan event/message subscriber subscribing a particular topic published byan event/message publisher. An owner of an event can be any one of theprocessing modules that process sensor data produced by any of sensorsof sensor system 115, such as, for example, autonomous driving modules501, user display system 502, or monitor 516. In addition, taskscheduler 511 determines input data required by the timer event. Forexample, an event identifier of an event may include informationidentifying both the owner of the event and the input data required bythe event.

In one embodiment, task scheduler 511 hashes the event identifier usinghash table 810 to identify a data structure storing the input data. Theoutput of the hash operation reveals the data structure of the inputdata such as a pointer pointing to the head of the data structure. Taskscheduler 511 then launches or wakes up a worker thread to execute aprocessing module associated with the owner of the timer event andpasses the pointer of the data structure storing the input data to theworker thread. The worker thread can obtain input data via the pointerwithout having to copy the input data from global store 512, which istime and resource consuming. Note that an event may identify input datafrom multiple data structures. In such a scenario, pointers of the datastructures are then passed to the worker thread.

For example, in response to a timer event, task scheduler 511 determinesthat the timer event is triggered for perception module 302 and thetimer event requires sensor data (e.g., point cloud data) generated byLIDAR device 215. Task scheduler 511 launches or wakes up a workerthread executing an executable code of perception module 302 and passesthe pointer of a data structure that stores the sensor data for LIDARdevice 215, in the above example, the pointer of data structure 801, tothe worker thread.

In one embodiment, the worker thread retrieves input data (e.g., IOevent data) from the head of the data structure, where the data store atthe head of the data structure is the newest data generated by an IOevent. The rationale behind it is that autonomous driving modules aremore interested to process the newest data since the newest datareflects the most current driving environment of the ADV. The autonomousdriving decisions made on the newest data will be more accurate. Thus,data stored in data structures 801-803 are processed similar to afirst-in-last-out (FILO) manner similar to a stack.

In one embodiment, each component as an event/message subscriber canonly have read-only privilege to the data structures that are not ownedby the component. A component can write data (e.g., output data) intoits associated data structure or data structures, but it would have togo through task scheduler 511 as described above. Also note that when aprocessing module processes event data in response to a timer event, theprocessing module does not remove any data from the data structure thatstores the input data. Rather, the older data in each data structurewill be archived by archiving module 517 to an event log correspondingto that particular topic in a persistent storage device (e.g., eventlogs 503 of persistent storage device 352).

In one embodiment, archiving module 517 determines whether a particularevent entry is older than a predetermined period of time from thecurrent time. If there is an event older than a predetermined period oftime, archiving module 517 removes the event entry from thecorresponding data structure and stores in an event log corresponding tothe data structure. In one embodiment, each event entry includes atimestamp representing time when the event was generated and data of theevent. By comparing a timestamp of an event against the current systemtime, archiving module 517 can determine whether the event entry shouldbe archived. In one embodiment, archiving module 517 periodically scansall of the data structures 801-803. For example, timer logic canperiodically issues an archive event and in response to the archiveevent, task scheduler 511 invokes archiving module 517 in a workerthread and passes the pointers of the data structures to archivingmodule 517 to enable archiving module 517 to scan the data structures.Thus, the archiving module always removes and archive an event from thetail of the data structure, e.g., in a FIFO order. On the other hand, aprocessing module processes the data of the data structure in a FILOorder.

FIG. 9 is a flow diagram illustrating a process of operating anautonomous driving vehicle according to one embodiment. Process 900 maybe performed by processing logic which may include software, hardware,or a combination thereof. For example, process 900 may be performed bytask scheduler 511. Referring to FIG. 9, in operation 901, processinglogic maintains a single global store to store event data of events. Theevents may include IO events for sensors and/or timer events ofprocessing modules of an ADV. In operation 902, processing logicmaintains a task scheduler executed in a single thread that isresponsible for managing data stored in the global store. In operation903, in response to a first event indicating a first result receivedfrom a first processing module (e.g., a sensor or a first autonomousdriving module), the task scheduler identifies and stores the firstresult to a corresponding first data structure of the global store. Inoperation 904, in response to a request from a second processing module(e.g., a second autonomous driving module) to process the first result,for example, via a timer event, the task scheduler invokes the secondprocessing module and passes a pointer of the first data structure tothe second processing module to allow the second processing module toprocess the data stored therein. In operation 905, in response to asecond result from the second processing module, the task schedulerstores the second result in a second data structure of the global store.The second data structure is specifically configured to store outputdata generated from the second processing module.

FIG. 10 is a flow diagram illustrating a process of operating anautonomous driving vehicle according to another embodiment. Process 1000may be performed by processing logic which may include software,hardware, or a combination thereof. For example, process 1000 may beperformed by task scheduler 511. Referring to FIG. 10, in operation1001, processing logic maintains an event queue to store IO eventsgenerated from various sensors and timer events generated for autonomousdriving modules. For each of the events stored in the event queue, inoperation 1002, processing logic determines a type of the event based ona topic associated with the event. In response to determining that theevent is an IO event, in operation 1003, processing logic stores eventdata associated with the IO event in the global store. In operation1004, in response to determining that the event is a timer event,processing logic launches or wakes up a worker thread associated withthe timer event, where the worker thread executes one of the autonomousdriving modules that triggered the timer event. In operation 1005,processing logic provides input data retrieved from the global store tothe worker thread to allow the worker thread to process the input data.

FIG. 11 is a flow diagram illustrating a process of operating anautonomous driving vehicle according to another embodiment. Process 1100may be performed by processing logic which may include software,hardware, or a combination thereof. For example, process 1100 may beperformed by task scheduler 511. Referring to FIG. 11, in operation1101, processing logic maintains a global store to store a number ofdata structures. Each of the data structures includes a number ofentries and each entry stores data of a particular event in achronological order. Each of the data structure is associated with oneof the sensors or one of the autonomous driving modules of an ADV. Inoperation 1102, processing logic receives a first event associated witha first autonomous driving module, where the first event contains afirst topic ID that identifies a first topic. In response to the firstevent, in operation 1103, processing logic hashes the first topic IDusing a predetermined hash table to identify one or more first datastructures corresponding to the first event. In operation 1104,processing logic passes pointers of the heads of the first datastructures to the first autonomous driving module to allow the firstautonomous driving module to process data of the first event.

Note that some or all of the components as shown and described above maybe implemented in software, hardware, or a combination thereof. Forexample, such components can be implemented as software installed andstored in a persistent storage device, which can be loaded and executedin a memory by a processor (not shown) to carry out the processes oroperations described throughout this application. Alternatively, suchcomponents can be implemented as executable code programmed or embeddedinto dedicated hardware such as an integrated circuit (e.g., anapplication specific IC or ASIC), a digital signal processor (DSP), or afield programmable gate array (FPGA), which can be accessed via acorresponding driver and/or operating system from an application.Furthermore, such components can be implemented as specific hardwarelogic in a processor or processor core as part of an instruction setaccessible by a software component via one or more specificinstructions.

FIG. 12 is a block diagram illustrating an example of a data processingsystem which may be used with one embodiment of the disclosure. Forexample, system 1500 may represent any of data processing systemsdescribed above performing any of the processes or methods describedabove, such as, for example, perception and planning system 110 or anyof servers 103-104 of FIG. 1. System 1500 can include many differentcomponents. These components can be implemented as integrated circuits(ICs), portions thereof, discrete electronic devices, or other modulesadapted to a circuit board such as a motherboard or add-in card of thecomputer system, or as components otherwise incorporated within achassis of the computer system.

Note also that system 1500 is intended to show a high level view of manycomponents of the computer system. However, it is to be understood thatadditional components may be present in certain implementations andfurthermore, different arrangement of the components shown may occur inother implementations. System 1500 may represent a desktop, a laptop, atablet, a server, a mobile phone, a media player, a personal digitalassistant (PDA), a Smartwatch, a personal communicator, a gaming device,a network router or hub, a wireless access point (AP) or repeater, aset-top box, or a combination thereof. Further, while only a singlemachine or system is illustrated, the term “machine” or “system” shallalso be taken to include any collection of machines or systems thatindividually or jointly execute a set (or multiple sets) of instructionsto perform any one or more of the methodologies discussed herein.

In one embodiment, system 1500 includes processor 1501, memory 1503, anddevices 1505-1508 connected via a bus or an interconnect 1510. Processor1501 may represent a single processor or multiple processors with asingle processor core or multiple processor cores included therein.Processor 1501 may represent one or more general-purpose processors suchas a microprocessor, a central processing unit (CPU), or the like. Moreparticularly, processor 1501 may be a complex instruction set computing(CISC) microprocessor, reduced instruction set computing (RISC)microprocessor, very long instruction word (VLIW) microprocessor, orprocessor implementing other instruction sets, or processorsimplementing a combination of instruction sets. Processor 1501 may alsobe one or more special-purpose processors such as an applicationspecific integrated circuit (ASIC), a cellular or baseband processor, afield programmable gate array (FPGA), a digital signal processor (DSP),a network processor, a graphics processor, a communications processor, acryptographic processor, a co-processor, an embedded processor, or anyother type of logic capable of processing instructions.

Processor 1501, which may be a low power multi-core processor socketsuch as an ultra-low voltage processor, may act as a main processingunit and central hub for communication with the various components ofthe system. Such processor can be implemented as a system on chip (SoC).Processor 1501 is configured to execute instructions for performing theoperations and steps discussed herein. System 1500 may further include agraphics interface that communicates with optional graphics subsystem1504, which may include a display controller, a graphics processor,and/or a display device.

Processor 1501 may communicate with memory 1503, which in one embodimentcan be implemented via multiple memory devices to provide for a givenamount of system memory. Memory 1503 may include one or more volatilestorage (or memory) devices such as random access memory (RAM), dynamicRAM (DRAM), synchronous DRAM (SDRAM), static RAM (SRAM), or other typesof storage devices. Memory 1503 may store information includingsequences of instructions that are executed by processor 1501, or anyother device. For example, executable code and/or data of a variety ofoperating systems, device drivers, firmware (e.g., input output basicsystem or BIOS), and/or applications can be loaded in memory 1503 andexecuted by processor 1501. An operating system can be any kind ofoperating systems, such as, for example, Robot Operating System (ROS),Windows® operating system from Microsoft®, Mac OS®/iOS® from Apple,Android® from Google®, LINUX, UNIX, or other real-time or embeddedoperating systems.

System 1500 may further include IO devices such as devices 1505-1508,including network interface device(s) 1505, optional input device(s)1506, and other optional IO device(s) 1507. Network interface device1505 may include a wireless transceiver and/or a network interface card(NIC). The wireless transceiver may be a WiFi transceiver, an infraredtransceiver, a Bluetooth transceiver, a WiMax transceiver, a wirelesscellular telephony transceiver, a satellite transceiver (e.g., a globalpositioning system (GPS) transceiver), or other radio frequency (RF)transceivers, or a combination thereof. The NIC may be an Ethernet card.

Input device(s) 1506 may include a mouse, a touch pad, a touch sensitivescreen (which may be integrated with display device 1504), a pointerdevice such as a stylus, and/or a keyboard (e.g., physical keyboard or avirtual keyboard displayed as part of a touch sensitive screen). Forexample, input device 1506 may include a touch screen controller coupledto a touch screen. The touch screen and touch screen controller can, forexample, detect contact and movement or break thereof using any of aplurality of touch sensitivity technologies, including but not limitedto capacitive, resistive, infrared, and surface acoustic wavetechnologies, as well as other proximity sensor arrays or other elementsfor determining one or more points of contact with the touch screen.

IO devices 1507 may include an audio device. An audio device may includea speaker and/or a microphone to facilitate voice-enabled functions,such as voice recognition, voice replication, digital recording, and/ortelephony functions. Other IO devices 1507 may further include universalserial bus (USB) port(s), parallel port(s), serial port(s), a printer, anetwork interface, a bus bridge (e.g., a PCI-PCI bridge), sensor(s)(e.g., a motion sensor such as an accelerometer, gyroscope, amagnetometer, a light sensor, compass, a proximity sensor, etc.), or acombination thereof. Devices 1507 may further include an imagingprocessing subsystem (e.g., a camera), which may include an opticalsensor, such as a charged coupled device (CCD) or a complementarymetal-oxide semiconductor (CMOS) optical sensor, utilized to facilitatecamera functions, such as recording photographs and video clips. Certainsensors may be coupled to interconnect 1510 via a sensor hub (notshown), while other devices such as a keyboard or thermal sensor may becontrolled by an embedded controller (not shown), dependent upon thespecific configuration or design of system 1500.

To provide for persistent storage of information such as data,applications, one or more operating systems and so forth, a mass storage(not shown) may also couple to processor 1501. In various embodiments,to enable a thinner and lighter system design as well as to improvesystem responsiveness, this mass storage may be implemented via a solidstate device (SSD). However in other embodiments, the mass storage mayprimarily be implemented using a hard disk drive (HDD) with a smalleramount of SSD storage to act as a SSD cache to enable non-volatilestorage of context state and other such information during power downevents so that a fast power up can occur on re-initiation of systemactivities. Also a flash device may be coupled to processor 1501, e.g.,via a serial peripheral interface (SPI). This flash device may providefor non-volatile storage of system software, including BIOS as well asother firmware of the system.

Storage device 1508 may include computer-accessible storage medium 1509(also known as a machine-readable storage medium or a computer-readablemedium) on which is stored one or more sets of instructions or software(e.g., module, unit, and/or logic 1528) embodying any one or more of themethodologies or functions described herein. Processingmodule/unit/logic 1528 may represent any of the components describedabove, such as, for example, planning module 305, control module 306, ortask scheduler 511. Processing module/unit/logic 1528 may also reside,completely or at least partially, within memory 1503 and/or withinprocessor 1501 during execution thereof by data processing system 1500,memory 1503 and processor 1501 also constituting machine-accessiblestorage media. Processing module/unit/logic 1528 may further betransmitted or received over a network via network interface device1505.

Computer-readable storage medium 1509 may also be used to store the somesoftware functionalities described above persistently. Whilecomputer-readable storage medium 1509 is shown in an exemplaryembodiment to be a single medium, the term “computer-readable storagemedium” should be taken to include a single medium or multiple media(e.g., a centralized or distributed database, and/or associated cachesand servers) that store the one or more sets of instructions. The terms“computer-readable storage medium” shall also be taken to include anymedium that is capable of storing or encoding a set of instructions forexecution by the machine and that cause the machine to perform any oneor more of the methodologies of the present disclosure. The term“computer-readable storage medium” shall accordingly be taken toinclude, but not be limited to, solid-state memories, and optical andmagnetic media, or any other non-transitory machine-readable medium.

Processing module/unit/logic 1528, components and other featuresdescribed herein can be implemented as discrete hardware components orintegrated in the functionality of hardware components such as ASICS,FPGAs, DSPs or similar devices. In addition, processingmodule/unit/logic 1528 can be implemented as firmware or functionalcircuitry within hardware devices. Further, processing module/unit/logic1528 can be implemented in any combination hardware devices and softwarecomponents.

Note that while system 1500 is illustrated with various components of adata processing system, it is not intended to represent any particulararchitecture or manner of interconnecting the components; as suchdetails are not germane to embodiments of the present disclosure. Itwill also be appreciated that network computers, handheld computers,mobile phones, servers, and/or other data processing systems which havefewer components or perhaps more components may also be used withembodiments of the disclosure.

Some portions of the preceding detailed descriptions have been presentedin terms of algorithms and symbolic representations of operations ondata bits within a computer memory. These algorithmic descriptions andrepresentations are the ways used by those skilled in the dataprocessing arts to most effectively convey the substance of their workto others skilled in the art. An algorithm is here, and generally,conceived to be a self-consistent sequence of operations leading to adesired result. The operations are those requiring physicalmanipulations of physical quantities.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. Unlessspecifically stated otherwise as apparent from the above discussion, itis appreciated that throughout the description, discussions utilizingterms such as those set forth in the claims below, refer to the actionand processes of a computer system, or similar electronic computingdevice, that manipulates and transforms data represented as physical(electronic) quantities within the computer system's registers andmemories into other data similarly represented as physical quantitieswithin the computer system memories or registers or other suchinformation storage, transmission or display devices.

Embodiments of the disclosure also relate to an apparatus for performingthe operations herein. Such a computer program is stored in anon-transitory computer readable medium. A machine-readable mediumincludes any mechanism for storing information in a form readable by amachine (e.g., a computer). For example, a machine-readable (e.g.,computer-readable) medium includes a machine (e.g., a computer) readablestorage medium (e.g., read only memory (“ROM”), random access memory(“RAM”), magnetic disk storage media, optical storage media, flashmemory devices).

The processes or methods depicted in the preceding figures may beperformed by processing logic that comprises hardware (e.g. circuitry,dedicated logic, etc.), software (e.g., embodied on a non-transitorycomputer readable medium), or a combination of both. Although theprocesses or methods are described above in terms of some sequentialoperations, it should be appreciated that some of the operationsdescribed may be performed in a different order. Moreover, someoperations may be performed in parallel rather than sequentially.

Embodiments of the present disclosure are not described with referenceto any particular programming language. It will be appreciated that avariety of programming languages may be used to implement the teachingsof embodiments of the disclosure as described herein.

In the foregoing specification, embodiments of the disclosure have beendescribed with reference to specific exemplary embodiments thereof. Itwill be evident that various modifications may be made thereto withoutdeparting from the broader spirit and scope of the disclosure as setforth in the following claims. The specification and drawings are,accordingly, to be regarded in an illustrative sense rather than arestrictive sense.

What is claimed is:
 1. An autonomous driving system for controlling anautonomous driving vehicle, the system comprising: a plurality ofsensors to sense a driving environment surrounding an autonomous drivingvehicle (ADV); a plurality of autonomous driving modules to process dataand control the ADV, wherein a timer event is periodically generated forat least one of the plurality of autonomous driving modules; a globalstore to store data generated and used by the sensors and the autonomousdriving modules; and a task scheduler coupled to the sensors, theautonomous driving modules, and the global store, wherein in response tooutput data generated by any one of the sensors and the autonomousdriving modules, the task scheduler stores the output data in the globalstore, and wherein in response to a request from any one of theautonomous driving modules for processing data, the task schedulerprovides input data stored in the global store to the autonomous drivingmodule, and wherein the sensors and the autonomous driving modules haveto go through the task scheduler in order to access the data stored inthe global store.
 2. The system of claim 1, further comprising aplurality of input and output (IO) drivers, each IO driver correspondingto one of the plurality of sensors, wherein an IO driver of a sensor isconfigured to receive and process sensor data from a correspondingsensor, and store the processed sensor data in the global store via thetask scheduler.
 3. The system of claim 2, further comprising a dataadaptor to convert the sensor data of a sensor from a first formatcompatible to a corresponding IO driver to a second format as a unifiedformat before storing the sensor data in the global store.
 4. The systemof claim 1, wherein the timer event includes information identifying thecorresponding autonomous driving module.
 5. The system of claim 1,wherein in response to a timer event associated with a first autonomousdriving module, the task scheduler identifies first data stored in theglobal store that is associated with the timer event and provides thefirst data to the first autonomous driving module to allow the firstautonomous driving module to process the first data.
 6. The system ofclaim 5, wherein in response to a notification from the first autonomousdriving module, the task scheduler obtains second data from thenotification as an output of processing the first data and stores thesecond data in the global store.
 7. The system of claim 1, wherein eachof the autonomous driving modules is executed within a respectivethread, and wherein when a timer event lapses, a corresponding thread iswoke up to receive input data from the global store via the taskscheduler and to process the input data.
 8. A computer-implementedmethod for operating an autonomous driving vehicle, the methodcomprising: maintaining a global store to store data generated and usedby a plurality of sensors and a plurality of autonomous driving modulesof an autonomous driving vehicle (ADV), the sensors sensing a drivingenvironment of the ADV, wherein the autonomous driving modules areconfigured to process data generated from the sensors, wherein a timerevent is periodically generated for at least one of the plurality ofautonomous driving modules; and executing a task scheduler in a singlethread to manage data stored in the global store, including in responseto output data generated by any one of the sensors and the autonomousdriving modules, storing the output data in the global store, and inresponse to a request from any one of the autonomous driving modules forprocessing data, providing input data stored in the global store to theautonomous driving module, wherein the sensors and the autonomousdriving modules have to go through the task scheduler in order to accessthe data stored in the global store.
 9. The method of claim 8, furthercomprising executing a plurality of input and output (IO) drivers, eachIO driver corresponding to one of the plurality of sensors, wherein anIO driver of a sensor is configured to receive and process sensor datafrom a corresponding sensor, and store the processed sensor data in theglobal store via the task scheduler.
 10. The method of claim 9, furthercomprising converting sensor data of a sensor from a first formatcompatible to a corresponding IO driver to a second format as a unifiedformat before storing the sensor data in the global store.
 11. Themethod of claim 8, wherein the timer event includes informationidentifying the corresponding autonomous driving module.
 12. The methodof claim 11, wherein each of the autonomous driving modules is executedwithin a respective thread, and wherein when a timer event lapses, acorresponding thread is woke up to receive input data from the globalstore via the task scheduler and to process the input data.
 13. Themethod of claim 8, further comprising: in response to a timer eventassociated with a first autonomous driving module, identifying firstdata stored in the global store that is associated with the timer event;and providing the first data to the first autonomous driving module toallow the first autonomous driving module to process the first data. 14.The method of claim 13, further comprising: in response to anotification from the first autonomous driving module, obtaining seconddata from the notification as an output of processing the first data;and storing the second data in the global store.
 15. A non-transitorymachine-readable medium having instructions stored therein, which whenexecuted by a processor, cause the processor to perform operations, theoperations comprising: maintaining a global store to store datagenerated and used by a plurality of sensors and a plurality ofautonomous driving modules of an autonomous driving vehicle (ADV), thesensors sensing a driving environment of the ADV, wherein the autonomousdriving modules are configured to process data generated from thesensors and a timer event is periodically generated for at least one ofthe plurality of autonomous driving modules; and executing a taskscheduler in a single thread to manage data stored in the global store,including in response to output data generated by any one of the sensorsand the autonomous driving modules, storing the output data in theglobal store, and in response to a request from any one of theautonomous driving modules for processing data, providing input datastored in the global store to the autonomous driving module, wherein thesensors and the autonomous driving modules have to go through the taskscheduler in order to access the data stored in the global store. 16.The machine-readable medium of claim 15, wherein the operations furthercomprise executing a plurality of input and output (IO) drivers, each IOdriver corresponding to one of the plurality of sensors, wherein an IOdriver of a sensor is configured to receive and process sensor data froma corresponding sensor, and store the processed sensor data in theglobal store via the task scheduler.
 17. The machine-readable medium ofclaim 16, wherein the operations further comprise converting sensor dataof a sensor from a first format compatible to a corresponding IO driverto a second format as a unified format before storing the sensor data inthe global store.
 18. The machine-readable medium of claim 15, whereinthe timer event includes information identifying the correspondingautonomous driving module.
 19. The machine-readable medium of claim 15,wherein the operations further comprise: in response to a timer eventassociated with a first autonomous driving module, identifying firstdata stored in the global store that is associated with the timer event;and providing the first data to the first autonomous driving module toallow the first autonomous driving module to process the first data. 20.The machine-readable medium of claim 19, wherein the operations furthercomprise: in response to a notification from the first autonomousdriving module, obtaining second data from the notification as an outputof processing the first data; and storing the second data in the globalstore.
 21. The machine-readable medium of claim 15, wherein each of theautonomous driving modules is executed within a respective thread, andwherein when a timer event lapses, a corresponding thread is woke up toreceive input data from the global store via the task scheduler and toprocess the input data.